package h.a.a.j;

/* compiled from: LongHashMap */
public final class c<T> {
    public a<T>[] a = new a[16];
    public int b = 16;
    public int c = 21;
    public int d;

    /* compiled from: LongHashMap */
    public static final class a<T> {
        public final long a;
        public T b;
        public a<T> c;

        public a(long j, T t, a<T> aVar) {
            this.a = j;
            this.b = t;
            this.c = aVar;
        }
    }

    public T a(long j) {
        for (a aVar = this.a[((((int) j) ^ ((int) (j >>> 32))) & Integer.MAX_VALUE) % this.b]; aVar != null; aVar = aVar.c) {
            if (aVar.a == j) {
                return aVar.b;
            }
        }
        return null;
    }

    public T b(long j, T t) {
        int i = ((((int) j) ^ ((int) (j >>> 32))) & Integer.MAX_VALUE) % this.b;
        a aVar = this.a[i];
        for (a aVar2 = aVar; aVar2 != null; aVar2 = aVar2.c) {
            if (aVar2.a == j) {
                Object obj = aVar2.b;
                aVar2.b = t;
                return obj;
            }
        }
        this.a[i] = new a(j, t, aVar);
        int i2 = this.d + 1;
        this.d = i2;
        if (i2 > this.c) {
            d(this.b * 2);
        }
        return null;
    }

    public T c(long j) {
        int i = ((((int) j) ^ ((int) (j >>> 32))) & Integer.MAX_VALUE) % this.b;
        a aVar = this.a[i];
        a aVar2 = null;
        while (aVar != null) {
            a aVar3 = aVar.c;
            if (aVar.a == j) {
                if (aVar2 == null) {
                    this.a[i] = aVar3;
                } else {
                    aVar2.c = aVar3;
                }
                this.d--;
                return aVar.b;
            }
            aVar2 = aVar;
            aVar = aVar3;
        }
        return null;
    }

    public void d(int i) {
        a[] aVarArr = new a[i];
        for (a aVar : this.a) {
            a aVar2;
            while (aVar2 != null) {
                long j = aVar2.a;
                int i2 = ((((int) (j >>> 32)) ^ ((int) j)) & Integer.MAX_VALUE) % i;
                a aVar3 = aVar2.c;
                aVar2.c = aVarArr[i2];
                aVarArr[i2] = aVar2;
                aVar2 = aVar3;
            }
        }
        this.a = aVarArr;
        this.b = i;
        this.c = (i * 4) / 3;
    }
}
